package com.dm.shop.service;

import com.qiniu.common.QiniuException;

import java.io.File;
import java.io.InputStream;

/**
 * @version 1.0
 * @author: Saiya Wang
 * @desc: 七流云上传图片配置Service
 * @date: 2021/7/24 10:50
 */
public interface QnUploadSerive {
    /**
     * 以文件形式上传
     * @param file
     * @return
     * @throws QiniuException
     */
    String uploadFile(File file, String fileName) throws QiniuException;

    /**
     * 通过流上传
     * @param inputStream
     * @param fileName
     * @return
     * @throws QiniuException
     */
    String uploadFile(InputStream inputStream, String fileName) throws QiniuException;


    /**
     * 通过关键字删除
     * @param key
     * @return
     * @throws QiniuException
     */
    String delete(String key) throws QiniuException;

    void afterPropertiesSet();

    /**
     * 获取上传token
     * @return
     */
    String getUploadToken();

}
